<?php

namespace app\api\controller;

use app\common\controller\Api;
use think\Controller;
use think\Request;

class Business extends Api
{
    public function index()
    {
        if($this->request->isPost())
        {
            $list = ysh_select($this->request->controller());
            return fh(200,'success','',$list);
        }
    }
    public function view()
    {
    	if($this->request->isPost()){
    		$post = post();
    		if(!isset($post['id'])) return fh(200,'error','缺少商铺id',[]);
    		$list = ysh_select('business',['where'=>[['id','=',$post['id']]]],2);
    		if($list){
    			return fh(200,'success','',$list);
    		}else{
    			return fh(200,'error','数据为空',[]);
    		}
    	}
    }
}
